package com.training.net;

import com.training.bean.Course;
import com.training.bean.CourseContent;
import com.training.bean.CourseStage;
import com.training.bean.Feedback;
import com.training.bean.LearningTrackData;
import com.training.bean.User;
import com.training.bean.AppVersion;

import java.util.ArrayList;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface QueryInterface {
    @POST(Constant.LOGIN)
    Call<HttpResponse<User>> login(
            @Query("phone") String username,
            @Query("password") String password
    );

    @GET(Constant.GET_ALL_STAGE)
    Call<HttpResponse<ArrayList<CourseStage>>> getAllStage();

    @GET(Constant.GET_ALL_COURSE)
    Call<HttpResponse<ArrayList<Course>>> getAllCourse(@Query("csid") int stageId);

    @GET(Constant.GET_ALL_COURSE_CONTENT)
    Call<HttpResponse<ArrayList<CourseContent>>> getAllCourseContent(@Query("cid") int cid);

    @GET(Constant.GET_USER_COLLECT)
    Call<HttpResponse<ArrayList<Course>>> getUserCollect();
    @POST(Constant.POST_COLLECT)
    Call<HttpResponse<String>> collect(@Query("cid") int cid);
    
    @POST(Constant.ADD_FEEDBACK)
    Call<HttpResponse<Feedback>> addFeedback(@Query("content") String content);
    
    @GET(Constant.CHECK_VERSION)
    Call<HttpResponse<AppVersion>> checkVersion();

    @POST(Constant.UPLOAD_PUBLIC_KEY)
    Call<HttpResponse<String>> uploadPublicKey(@Query("publicKey") String publicKey);

    @GET(Constant.GET_ENCRYPTED_AES_KEY)
    Call<HttpResponse<String>> getEncryptedAESKey();

    @POST(Constant.POST_BATCH_REPORT)
    Call<HttpResponse<String>> batchReport(ArrayList<LearningTrackData> learningTracks);
}
